<template>
  <div id="page">
    <div class="top_box">
      <img v-src="'/static/img/my/becomePartnerTop.jpg'">
    </div>
    <div class="container">
      <div class="desc">
        <h1>合伙人的尖货赚钱方式</h1>
        <p>
          说明：当您已经是我们的合伙人，那将您喜欢的商品生成文案分享到朋友圈后，您的的小伙伴们喜欢此商品并且领券下单，最终产生的推广收益将全部属于您！小仙女们最爱的分享互动，动动手指赚外快，在家躺尸分分钟赚碗面条钱！!分分分分钟赚个工资钱！！
        </p>
      </div>
      <div class="tiaojian">
        <h1>怎样成为合伙人？ </h1>
        <p>
          将我们的推广文案分享到朋友圈，当点击量达到一定数量后即可申请成为合伙人，似（是）不似（是）超级简单，真的是so easy so happy!
        </p>
      </div>
      <div class="renwulist">
        <h1>任务列表:</h1>
        <div class="listBox">
          <div class="item" v-for="(item,index) in pageData">
              <div @click="checkclick(index)" class="textbox" :class="{'addclass':currentIndex==index}">
                <div class="name">{{index+1}} . {{item.name}}</div>
                <div class="desce">{{item.desp}}</div>
              </div>
          </div>

        </div>
      </div>
    </div>
    <div class="bottomShare">
      <img @click="share" v-src="'/static/img/my/share.png'" alt="">
    </div>
  </div>
</template>
<script>
  import {GETPARNTERLIST} from 'src/const/uri';
  export default {
    data() {
      return {
        demo2:true,
        pageData: [],
        currentIndex:0,
        checker:false,
      }
    },
    created() {

    },
    mounted() {
      this.initData();
      let spinner = document.getElementsByClassName('spinner')[0];
      spinner.style.display = 'none';
    },
    methods: {
      initData(){
        this.$ajax.get(GETPARNTERLIST, {}, (res) => {
          console.log(res.data);
          this.pageData = res.data.data;
        });
      },
      refreshData(responseCallback) {
        this.initData();
        responseCallback({code: '0'});
      },
      change() {
      },
      share() {
        if(this.currentIndex!==null){
          if (window.WebViewJavascriptBridge) {
            window.WebViewJavascriptBridge.callHandler('share', {
              missionId:this.pageData[this.currentIndex].id,
              linkUrl: this.pageData[this.currentIndex].linkUrl,
              wxIconPath: this.pageData[this.currentIndex].wxIconPath,
              wxTitle: this.pageData[this.currentIndex].wxTitle
            })
          } else if (isDebug) {

          }
        }else{
          this.$vux.toast.show({type:'text',text:'选中任务才能分享到朋友圈'});
        }
      },
      checkclick(index){
        if(index !==this.currentIndex){
          this.currentIndex=index;
        }else{
          this.currentIndex=null;
         // this.checker=true;
        }
      }
    }
  }
</script>
<style lang="less" scoped>
  @import "index";
</style>
